const app = getApp();
Page({
  data:{
    liveHistory: []
  },
  onShow() {
    this.getLiveHistoryList();
  }, 
  
  goDetail(e) {
    app.util.navigateTo('cm_trtc_1/pages/live-phone/live-history/video-review?userid=' + e.currentTarget.dataset.userid);
  },

  getLiveHistoryList() {
    const options = {
      url: 'entry/wxapp/index',
      data: {
        op: 'getUserIdList',
      },
    };
    const success = res => {
      if(!res.data.data || !res.data.data.lists){
        return;
      }

      this.setData({
        liveHistory: res.data.data.lists,
      })
    };
    const fail = msg => {
      console.log(msg);
    };
    this.doRequest(options, success, fail);
  },

  doRequest(options, success = null, fail = null) {
    app.util.request({
      ...options,
      module: 'cm_trtc',
      success,
      fail,
    });
  },
});